<!-- 权限编辑 -->
<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal">
        <span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
    </button>
    <h4 class="modal-title" id="mod-title">{$meta_title}</h4>
</div>
<div class="modal-body" id="content">
    <form class="form-horizontal m-t" id="signupForm">
        <input type="hidden" value="{$settingItem.id ?? ''}" name="id">
        <div class="form-group">
            <label class="col-sm-3 control-label">配置分组：</label>
            <div class="col-sm-4">
                <select class="form-control" name="group">
                    <?php foreach($group_list as $key => $item): ?>
                    <option value="{$key}" {if(isset($settingItem) && $settingItem.group ==$key)}selected {/if}>{$item}</option>
                    <?php endforeach;?>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">配置类型：</label>
            <div class="col-sm-7">
                <select class="form-control" name="type">
                    <?php foreach($type_list as $key => $item): ?>
                    <option value="{$key}" {if(isset($settingItem) && $settingItem.type ==$key)} selected {/if}>{$item}</option>
                    <?php endforeach;?>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">配置标识：</label>
            <div class="col-sm-7">
                <input type="text" class="form-control" name="name" placeholder="配置标识" value="{$settingItem.name ?? ''}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">配置标题：</label>
            <div class="col-sm-7">
                <input type="text" class="form-control" name="title" placeholder="配置标题" value="{$settingItem.title ?? ''}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">配置值：</label>
            <div class="col-sm-7">
                <textarea name="value" class="form-control">{$settingItem.value ?? ''}</textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">配置项：</label>
            <div class="col-sm-7">
                <textarea name="options" class="form-control">{$settingItem.options ?? ''}</textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">配置说明：</label>
            <div class="col-sm-7">
                <textarea name="tip" class="form-control">{$settingItem.tip ?? ''}</textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">排序：</label>
            <div class="col-sm-7">
                <input type="text" class="form-control" value="{$info.sort ?? '0'}" name="sort" placeholder="排序">
            </div>
        </div>
    </form>
</div>
<div class="modal-footer">
    <button type="button" class="btn btn-white" data-dismiss="modal">取消</button>
    <button type="button" class="btn btn-primary btn_save" data-dismiss="modal">快捷保存</button>
</div>

<script type="text/javascript">
    $(document).ready(function(){
        $(".btn_save").bind("click",function(){
            //  save
            $.ajax({
                url     :   "{:url('Setting/editSetting')}",
                dataType:   "json",
                type    :   "post",
                data    :   $("#signupForm").serialize(),
                success :   function( obj ){
                    layer.msg(obj.msg,{
                        shift   :   3
                    },function(){
                        if( obj.code === 1){
                            $('.setting_list').bootstrapTable('refresh', null);
                        }
                    });
                }
            });
        });

    });
</script>